<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - test/gmock-1.7.0/include/gmock/gmock-cardinalities.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">test/gmock-1.7.0/include/gmock</a> - gmock-cardinalities.h<span style="font-size: 80%;"> (source / <a href="gmock-cardinalities.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">16</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">14</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Copyright 2007, Google Inc.</a>
<span class="lineNum">       2 </span>            : // All rights reserved.
<span class="lineNum">       3 </span>            : //
<span class="lineNum">       4 </span>            : // Redistribution and use in source and binary forms, with or without
<span class="lineNum">       5 </span>            : // modification, are permitted provided that the following conditions are
<span class="lineNum">       6 </span>            : // met:
<span class="lineNum">       7 </span>            : //
<span class="lineNum">       8 </span>            : //     * Redistributions of source code must retain the above copyright
<span class="lineNum">       9 </span>            : // notice, this list of conditions and the following disclaimer.
<span class="lineNum">      10 </span>            : //     * Redistributions in binary form must reproduce the above
<span class="lineNum">      11 </span>            : // copyright notice, this list of conditions and the following disclaimer
<span class="lineNum">      12 </span>            : // in the documentation and/or other materials provided with the
<span class="lineNum">      13 </span>            : // distribution.
<span class="lineNum">      14 </span>            : //     * Neither the name of Google Inc. nor the names of its
<span class="lineNum">      15 </span>            : // contributors may be used to endorse or promote products derived from
<span class="lineNum">      16 </span>            : // this software without specific prior written permission.
<span class="lineNum">      17 </span>            : //
<span class="lineNum">      18 </span>            : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<span class="lineNum">      19 </span>            : // &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<span class="lineNum">      20 </span>            : // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
<span class="lineNum">      21 </span>            : // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
<span class="lineNum">      22 </span>            : // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
<span class="lineNum">      23 </span>            : // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<span class="lineNum">      24 </span>            : // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<span class="lineNum">      25 </span>            : // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
<span class="lineNum">      26 </span>            : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class="lineNum">      27 </span>            : // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<span class="lineNum">      28 </span>            : // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class="lineNum">      29 </span>            : //
<span class="lineNum">      30 </span>            : // Author: wan@google.com (Zhanyong Wan)
<span class="lineNum">      31 </span>            : 
<span class="lineNum">      32 </span>            : // Google Mock - a framework for writing C++ mock classes.
<span class="lineNum">      33 </span>            : //
<span class="lineNum">      34 </span>            : // This file implements some commonly used cardinalities.  More
<span class="lineNum">      35 </span>            : // cardinalities can be defined by the user implementing the
<span class="lineNum">      36 </span>            : // CardinalityInterface interface if necessary.
<span class="lineNum">      37 </span>            : 
<span class="lineNum">      38 </span>            : #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
<span class="lineNum">      39 </span>            : #define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span>            : #include &lt;limits.h&gt;
<span class="lineNum">      42 </span>            : #include &lt;ostream&gt;  // NOLINT
<span class="lineNum">      43 </span>            : #include &quot;gmock/internal/gmock-port.h&quot;
<span class="lineNum">      44 </span>            : #include &quot;gtest/gtest.h&quot;
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            : namespace testing {
<span class="lineNum">      47 </span>            : 
<span class="lineNum">      48 </span>            : // To implement a cardinality Foo, define:
<span class="lineNum">      49 </span>            : //   1. a class FooCardinality that implements the
<span class="lineNum">      50 </span>            : //      CardinalityInterface interface, and
<span class="lineNum">      51 </span>            : //   2. a factory function that creates a Cardinality object from a
<span class="lineNum">      52 </span>            : //      const FooCardinality*.
<span class="lineNum">      53 </span>            : //
<span class="lineNum">      54 </span>            : // The two-level delegation design follows that of Matcher, providing
<span class="lineNum">      55 </span>            : // consistency for extension developers.  It also eases ownership
<span class="lineNum">      56 </span>            : // management as Cardinality objects can now be copied like plain values.
<a name="57"><span class="lineNum">      57 </span>            : </a>
<span class="lineNum">      58 </span>            : // The implementation of a cardinality.
<a name="59"><span class="lineNum">      59 </span><span class="lineNoCov">          0 : class CardinalityInterface {</span></a>
<span class="lineNum">      60 </span>            :  public:
<span class="lineNum">      61 </span><span class="lineNoCov">          0 :   virtual ~CardinalityInterface() {}</span>
<span class="lineNum">      62 </span>            : 
<a name="63"><span class="lineNum">      63 </span>            :   // Conservative estimate on the lower/upper bound of the number of</a>
<a name="64"><span class="lineNum">      64 </span>            :   // calls allowed.</a>
<span class="lineNum">      65 </span><span class="lineNoCov">          0 :   virtual int ConservativeLowerBound() const { return 0; }</span>
<span class="lineNum">      66 </span><span class="lineNoCov">          0 :   virtual int ConservativeUpperBound() const { return INT_MAX; }</span>
<span class="lineNum">      67 </span>            : 
<span class="lineNum">      68 </span>            :   // Returns true iff call_count calls will satisfy this cardinality.
<span class="lineNum">      69 </span>            :   virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
<span class="lineNum">      70 </span>            : 
<span class="lineNum">      71 </span>            :   // Returns true iff call_count calls will saturate this cardinality.
<span class="lineNum">      72 </span>            :   virtual bool IsSaturatedByCallCount(int call_count) const = 0;
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span>            :   // Describes self to an ostream.
<span class="lineNum">      75 </span>            :   virtual void DescribeTo(::std::ostream* os) const = 0;
<span class="lineNum">      76 </span>            : };
<span class="lineNum">      77 </span>            : 
<span class="lineNum">      78 </span>            : // A Cardinality is a copyable and IMMUTABLE (except by assignment)
<span class="lineNum">      79 </span>            : // object that specifies how many times a mock function is expected to
<span class="lineNum">      80 </span>            : // be called.  The implementation of Cardinality is just a linked_ptr
<a name="81"><span class="lineNum">      81 </span>            : // to const CardinalityInterface, so copying is fairly cheap.</a>
<span class="lineNum">      82 </span>            : // Don't inherit from Cardinality!
<span class="lineNum">      83 </span><span class="lineNoCov">          0 : class GTEST_API_ Cardinality {</span>
<span class="lineNum">      84 </span>            :  public:
<span class="lineNum">      85 </span>            :   // Constructs a null cardinality.  Needed for storing Cardinality
<span class="lineNum">      86 </span>            :   // objects in STL containers.
<span class="lineNum">      87 </span>            :   Cardinality() {}
<a name="88"><span class="lineNum">      88 </span>            : </a>
<span class="lineNum">      89 </span>            :   // Constructs a Cardinality from its implementation.
<span class="lineNum">      90 </span><span class="lineNoCov">          0 :   explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}</span>
<span class="lineNum">      91 </span>            : 
<a name="92"><span class="lineNum">      92 </span>            :   // Conservative estimate on the lower/upper bound of the number of</a>
<a name="93"><span class="lineNum">      93 </span>            :   // calls allowed.</a>
<span class="lineNum">      94 </span><span class="lineNoCov">          0 :   int ConservativeLowerBound() const { return impl_-&gt;ConservativeLowerBound(); }</span>
<span class="lineNum">      95 </span><span class="lineNoCov">          0 :   int ConservativeUpperBound() const { return impl_-&gt;ConservativeUpperBound(); }</span>
<a name="96"><span class="lineNum">      96 </span>            : </a>
<span class="lineNum">      97 </span>            :   // Returns true iff call_count calls will satisfy this cardinality.
<span class="lineNum">      98 </span><span class="lineNoCov">          0 :   bool IsSatisfiedByCallCount(int call_count) const {</span>
<span class="lineNum">      99 </span><span class="lineNoCov">          0 :     return impl_-&gt;IsSatisfiedByCallCount(call_count);</span>
<span class="lineNum">     100 </span>            :   }
<a name="101"><span class="lineNum">     101 </span>            : </a>
<span class="lineNum">     102 </span>            :   // Returns true iff call_count calls will saturate this cardinality.
<span class="lineNum">     103 </span><span class="lineNoCov">          0 :   bool IsSaturatedByCallCount(int call_count) const {</span>
<span class="lineNum">     104 </span><span class="lineNoCov">          0 :     return impl_-&gt;IsSaturatedByCallCount(call_count);</span>
<span class="lineNum">     105 </span>            :   }
<span class="lineNum">     106 </span>            : 
<a name="107"><span class="lineNum">     107 </span>            :   // Returns true iff call_count calls will over-saturate this</a>
<span class="lineNum">     108 </span>            :   // cardinality, i.e. exceed the maximum number of allowed calls.
<span class="lineNum">     109 </span><span class="lineNoCov">          0 :   bool IsOverSaturatedByCallCount(int call_count) const {</span>
<span class="lineNum">     110 </span><span class="lineNoCov">          0 :     return impl_-&gt;IsSaturatedByCallCount(call_count) &amp;&amp;</span>
<span class="lineNum">     111 </span><span class="lineNoCov">          0 :         !impl_-&gt;IsSatisfiedByCallCount(call_count);</span>
<span class="lineNum">     112 </span>            :   }
<a name="113"><span class="lineNum">     113 </span>            : </a>
<span class="lineNum">     114 </span>            :   // Describes self to an ostream
<span class="lineNum">     115 </span><span class="lineNoCov">          0 :   void DescribeTo(::std::ostream* os) const { impl_-&gt;DescribeTo(os); }</span>
<span class="lineNum">     116 </span>            : 
<span class="lineNum">     117 </span>            :   // Describes the given actual call count to an ostream.
<span class="lineNum">     118 </span>            :   static void DescribeActualCallCountTo(int actual_call_count,
<span class="lineNum">     119 </span>            :                                         ::std::ostream* os);
<span class="lineNum">     120 </span>            : 
<span class="lineNum">     121 </span>            :  private:
<span class="lineNum">     122 </span>            :   internal::linked_ptr&lt;const CardinalityInterface&gt; impl_;
<span class="lineNum">     123 </span>            : };
<span class="lineNum">     124 </span>            : 
<span class="lineNum">     125 </span>            : // Creates a cardinality that allows at least n calls.
<span class="lineNum">     126 </span>            : GTEST_API_ Cardinality AtLeast(int n);
<span class="lineNum">     127 </span>            : 
<span class="lineNum">     128 </span>            : // Creates a cardinality that allows at most n calls.
<span class="lineNum">     129 </span>            : GTEST_API_ Cardinality AtMost(int n);
<span class="lineNum">     130 </span>            : 
<span class="lineNum">     131 </span>            : // Creates a cardinality that allows any number of calls.
<span class="lineNum">     132 </span>            : GTEST_API_ Cardinality AnyNumber();
<span class="lineNum">     133 </span>            : 
<span class="lineNum">     134 </span>            : // Creates a cardinality that allows between min and max calls.
<span class="lineNum">     135 </span>            : GTEST_API_ Cardinality Between(int min, int max);
<span class="lineNum">     136 </span>            : 
<span class="lineNum">     137 </span>            : // Creates a cardinality that allows exactly n calls.
<span class="lineNum">     138 </span>            : GTEST_API_ Cardinality Exactly(int n);
<span class="lineNum">     139 </span>            : 
<span class="lineNum">     140 </span>            : // Creates a cardinality from its implementation.
<span class="lineNum">     141 </span>            : inline Cardinality MakeCardinality(const CardinalityInterface* c) {
<span class="lineNum">     142 </span>            :   return Cardinality(c);
<span class="lineNum">     143 </span>            : }
<span class="lineNum">     144 </span>            : 
<span class="lineNum">     145 </span>            : }  // namespace testing
<span class="lineNum">     146 </span>            : 
<span class="lineNum">     147 </span>            : #endif  // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
